﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Qy.Scenario;

[SugarTable(DbTableName.CmsContentCate)]

public class ContentCate : ICategoryEntity
{
    [SugarColumn(IsPrimaryKey = true)]
    public int Id { get; set; }
    public int Pid { get; set; }
    public string Name { get; set; }
    public int Type { get; set; }
    public string Theme { get; set; }
    public string Ico { get; set; }
    public string Ctheme { get; set; }
    public int Sort { get; set; }
    public int Num { get; set; }
    public bool Status { get; set; }
    public string BannerHeader { get; set; }
    public string BannerAd { get; set; }
    public string BannerLit { get; set; }
}
public class EditContentCate
{
    public int Id { get; set; }
    [Display(Name = "上级类别")]
    public int Pid { get; set; }
    [Display(Name = "类别名称")]
    public string Name { get; set; }
    [Display(Name = "类别类型")]
    public int Type { get; set; }
    [Display(Name = "自定义模板")]
    public string Theme { get; set; }
    [Display(Name = "类别图标")]
    public string Ico { get; set; }
    [Display(Name = "内容模板")]
    public string Ctheme { get; set; }
    [Display(Name = "排序")]
    [RegularExpression(RegxPatterns.Number, ErrorMessage = "{0}必须为数字")]
    public int Sort { get; set; } = 0;
    [Display(Name = "前台显示条数")]
    [RegularExpression(RegxPatterns.Number, ErrorMessage = "{0}必须为数字")]
    public int Num { get; set; } = 15;
    [Display(Name = "禁用状态")]
    public bool Status { get; set; }
    [Display(Name = "类别头图")]
    public string BannerHeader { get; set; }
    [Display(Name = "类别广告图")]
    public string BannerAd { get; set; }
    [Display(Name = "类别小链接图")]
    public string BannerLit { get; set; }
}

public class ViewContentAndCate
{
    public int Id { get; set; }
    public int Cid { get; set; }
    public string Title { get; set; }
    public string Img { get; set; }
    public int Imgbl { get; set; }
    public string CateName { get; set; }
    public string Examine { get; set; }
    public string DeptName { get; set; }
    public string NickName { get; set; }
    public DateTime Time { get; set; }
    public bool Status { get; set; }
    public bool AttA { get; set; }
    public bool AttB { get; set; }
    public bool AttC { get; set; }
}

public class ContentCatViewModel
{
    public int Id { get; set; }
    public int Pid { get; set; }
    public string Title { get; set; }
    public int Type { get; set; }
    public string Theme { get; set; }
    public string Ico { get; set; }
    public string Ctheme { get; set; }
    public int Sort { get; set; }
    public int Num { get; set; }
    public bool Status { get; set; }
    public List<ContentCatViewModel> Children { set; get; } = new();
}